<?include_once('conn.php');?>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<? include_once('inc_head.php'); ?>
</head>
</head>

<body>
	<? local("添加问题");?>
	<div id="intro">
		<!-- ***************************************************** 默认状态**************************************************** -->
		<!-- ***************************************************** 默认状态**************************************************** -->
		<!-- ***************************************************** 默认状态**************************************************** -->
		<form name="formnewsadd" method="post" enctype="multipart/form-data" action="admin_vote_up.php">
			<table class="table_form" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
				<tr>
					<td width="70" class="allleftcar">标题</td>
					<td width="864"><input name="title" type="text" class=" :required form-control" id="title" size="70" value=""></td>
				</tr>

				<tr>
					<td class="allleftcar">类别</td>
					<td>
						<!--小类-->
						<?
						echo '<select name="smallname" id="smallname">';
						$cmd1="select * from ".TABLE_C."vote_series where forid=0 order by id";
						$rs1=mysql_query($cmd1) or die(mysql_error());
						while($row1=mysql_fetch_assoc($rs1)){
							echo '<optgroup  label='.$row1[name].'>';
							////////////////2级循环////////////////////////
							$cmd2="select * from ".TABLE_C."vote_series where forid={$row1[id]} order by id";
							$rs2=mysql_query($cmd2) or die(mysql_error());
							while($row2=mysql_fetch_assoc($rs2)){
								if($row2['id']==$_GET['sid']){
									echo '<option selected value='.$row2[id].'>&nbsp;&nbsp;|—'.$row2[name].'</option>';
								}else{
									echo '<option value='.$row2[id].'>&nbsp;&nbsp;|—'.$row2[name].'</option>';
								}
							}
							mysql_free_result($rs2);
							echo '</optgroup>';
						}
						mysql_free_result($rs1);
						echo '</select>';
						?>
					</td>
				</tr>


				<tr>
					<td class="allleftcar">&nbsp;</td>
					<td><button type="submit" class="btn btn-primary">保存</button></td>
				</tr>
			</table>
		</form>

		</div>
	<?include('inc_foot.php');?>
</body>
</html>